package com.ctrip.study.algorithm.link;

import org.apache.commons.beanutils.BeanUtils;

public class Link {

	private int iData;
	
	private double dData;
	
	public Link next;

	public Link(int iData, double dData) {
		this.iData = iData;
		this.dData = dData;
	}
	
	public void displayLink(){
		System.out.println("iData:" + iData + ",  dDouble: " + dData);
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(dData);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + iData;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Link other = (Link) obj;
		if (Double.doubleToLongBits(dData) != Double
				.doubleToLongBits(other.dData))
			return false;
		if (iData != other.iData)
			return false;
		return true;
	}
	
}
